/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package treenode.visitor;

/**
 *
 * @author Bartek
 */
public abstract class BinaryOperatorNode implements TreeNode {
    
    private TreeNode left, right;
    
    public BinaryOperatorNode() {
        left = right = null;
    }
    
    public BinaryOperatorNode(TreeNode left, TreeNode right) {
        this.left = left;
        this.right = right;
    }
    
    public TreeNode getLeft() {
        return left;
    }
    
    public TreeNode getRight() {
        return right;
    }
    
    @Override
    public void accept(Visitor v) {
        v.visitBinaryOperatorNode(this);
    }
    
    public abstract int compute(int left, int right);
}
